package com.armani.mapper;

import com.armani.entity.ItemType;
import com.armani.model.TypeModel;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ClassName TypeMapper
 * @Description 商品类别映射接口
 * @Author Admin
 * @Date 2021/11/27 10:57
 * @Version 1.0
 **/

public interface TypeMapper {
    List<ItemType> pageSearch(@Param(value = "startRow") Integer startRow,
                              @Param(value = "limit")Integer limit,
                              @Param(value = "id")Integer id);

    Integer getCount(@Param(value = "id") Integer id);

    Integer insert(@Param(value = "title")String title,
                   @Param(value = "parentId")Integer parentId,
                   @Param(value = "sort")Integer sort );

    Integer update(@Param(value = "id")Integer id,
                   @Param(value = "title")String title,
                   @Param(value = "parentId")Integer parentId,
                   @Param(value = "sort")Integer sort);

    Integer delete(@Param(value = "id")Integer id);

    /**
     * 根据parentId查分类列表
     * @param parentId 父级id
     * @return 分类列表集合
     */
    List<TypeModel> selectByParentId(int parentId);
    /**
     * 添加分类
     *
     * @param params 参数
     * @return 影响行数
     */
    Integer typeAdd(Map<String ,Object> params);
}
